package com.wzz.service;

import com.wzz.mapper.BApprovalMapper;
import com.wzz.pojo.BApproval;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class BApprovalService {

    @Autowired
    private BApprovalMapper mapper;

    public void add(BApproval data) {
        if(data.getId() != null && data.getId() > 0) {
            mapper.update(data);
        } else {
            mapper.add(data);
        }

    }

    public List<BApproval> queryAll() {
        return mapper.queryAll();
    }

    public BApproval queryById(int id) {
        return mapper.queryById(id);
    }
}
